package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;

import com.itheima.entity.Result;
import com.itheima.service.MemberService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author likun
 * @version V1.0
 * @date 2020/3/11 23:22
 */
@RestController
@RequestMapping("/riskAssessment")
public class LkRiskAssessmentController {
    @Reference
    private MemberService memberService;

    @RequestMapping("/findPage")
    public PageResult findPage(@RequestBody QueryPageBean pageBean){
        try{

            PageResult page4MenberRisk = memberService.findPage4MenberRisk(pageBean);
            return page4MenberRisk;
        } catch (Exception e){
            return null;
        }

    }
    @RequestMapping("/findMemberEcho")
    public Result findMemberEcho(Integer id){
        try {
            Map<String, Object> memberEcho = memberService.findMemberEcho(id);
            return new Result(true, "回显数据成功",memberEcho);
        } catch (Exception e){
            e.printStackTrace();
            return new Result(true, "回显数据成功");
        }
    }
}
